Plotly Express

Check the presentation blog post Introducing Plotly Express.

Tidy DataFrames as input in Plotly Express

Tidy Data according to Hadley Wickham: (original paper)

IMPORTANT: From Plotly.py version 4.8 it is no longer a requirement to use tidy dataframes. See this post.

Exercise 1

Use the example cluster data, loaded with:

... and convert it into a tidy dataframe (HINT: use pd.concat method). It should look like this:

Exercise 2

Take the tidy dataframe created in Exercise 1 and build this plot with two subplots:

And now making each subplot as a frame of an animated plot:

Exercise 3

Using the gapminder data:

Build the following plots:

and this animated plot:

Plotly Express powered backend for Pandas plotting

Since Pandas 0.25 it is possible to provide any backend for the .plot plotting API.

Plotly backend (see here) can be set with:

Then you can use the most common functionalities of Plotly Express by passing your Plotly parameters to the .plot method available to any pandas DataFrame;